home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
zbpc_460.zip
/
GRAPHICS.EXE
/
SHOWTYME.BAS
< prev
next >
Wrap
BASIC Source File
|
1991-03-20
|
2KB
|
84 lines
' SHOWTYME
' by James Ducasse
' (modified for speed by Andrew Gariepy)
:
' This is an excellent example of using the high-speed
' USR 8 and USR 9 Integer SINE and COSINE functions
' built into all versions of the ZBasic compiler
:
SELECT CARDTYPE
CASE 0 ' CGA card
MODE 5
Colormax = 4
CASE 1 ' EGA card
MODE 17
Colormax = 16
CASE 2 ' EGA card w/monochrome monitor
MODE 18
Colormax = 1
CASE 3 ' Hercules card
MODE 20
Colormax = 1
CASE 4 ' VGA card
MODE 22
Colormax = 16
CASE 5 ' VGA card /monochrome monitor
MODE 21
Colormax = 1
CASE 6 ' MCGA card
MODE 23
Colormax = 256
CASE 7 ' MCGA card w/monochrome monitor
MODE 23
Colormax = 256
CASE ELSE ' Either MPDA or not recognized!
MODE 2
Colormax = 1
END SELECT
CLS : RANDOMIZE
:
CR% = 7
V1 = 4
:
DO
LONG IF Colormax = 1
C1 = 1 : C2 = 1 : C3 = 1
XELSE
C1 = RND(Colormax-1) : C2 = RND(Colormax-1) : C3 = RND(Colormax-1)
END IF
COLOR = C1, C2, C3 : PRINT @(0,0) "Color ="; C1,C2,C3
FOR R = 0 TO 256
A% = USR 9 (Q * R) / 4
X1 = (USR 9 (R) * A%) / 50 + 512
Y1 = (USR 8 (R) * A%) / 50 + 384
B = R + E
B2% = USR 9 (V1 * B) / 4
X2 = (USR 9 (B) * B2%) / 50 + 512
Y2 = (USR 8 (B) * B2%) / 50 + 384
PLOT X1, Y1 TO X2, Y2
I$ = INKEY$
IF LEN(I$) THEN "END"
NEXT R
Q = RND(12)
IF Q = 7 THEN Q = 0
IF Q = 1 AND V1 = 0 THEN V1 = RND(12)
E = RND(200)
V1 = RND(12)
IF V1 = 7 THEN V1 = 0
IF V1 > 6 THEN V1 = V1 - 12
IF Q < 1 AND V1 = 1 THEN V1 = RND(50)
IF Q = 1 AND V1 = 1 THEN V1 = RND(100)
CR% = RND(17)
IF CR% = 2 THEN CR% = 4
IF CR% = 3 THEN CR% = 6
IF CR% > 6 AND C4% < 10 THEN CR% = CR% + 4
CR1% = CR% + 1
DELAY 2000
CLS
UNTIL LOOP ' LOOP = 0 so this is a never-ending loop
:
"END"
MODE 2
CLS
END